#newl #sing set format="docx:Office Open XML Text"|set format=docx|set format=odt|set format=pdf|set format=txt
#newl #sing set soffice_path=#ppth..\LibreOffice\program\soffice.exe|#newl #sing set soffice_path=#ppth..\LibreOfficePortable\App\libreoffice\program\soffice.exe|--path to Libre Office, put it in the same dir as gulmencoder, like "program files"--
#newl taskkill /f /im soffice.bin
#newl start "office" "%soffice_path%" |-program file-
--headless |-no gui-
#remark inifilter, needed for unsigned utf-8 .txt files|--infilter="Text (encoded):UTF8" |-inifilter, needed for unsigned utf-8 .txt files.-
--convert-to %format% |-format output-
--outdir "#path" |--outdir "#pathdocx" |
"#item" |-input-
#newl Timeout /T 30 |#newl Timeout /T 45 |#newl Timeout /T 60 |#newl Timeout /T 15 |--timeout--
#newl taskkill /f /im soffice.bin && del "#path#name.docx"

<comment>
Convert documents to docx, using libre office.
If not finished in 30 sec, terminate it.
-
Note: there is no Wait in the first start command.
Del command near the end, will delete incomplete converted file.
We use '.docx' instead of '%format%', cause you can't delete "docx:Office" colon thing.
Delete will be done if killing process is succesfull.




TASKKILL /FI "IMAGENAME eq soffice.*" /F /IM *
taskkill /f /im soffice.bin
when you close bin, exe closes too? check it.



#newl taskkill /f /im soffice.bin && echo worked || echo not worked

